package cn.wolfcode.enums;

import lombok.Getter;

@Getter
public enum  AppointmentStarusEnum {
//    枚举类只能get,不能set.左边为name,右边为value
    PEND("待确认",0),//相当于 public static AppointmentStarusEnum PEND=new AppointmentStarusEnum(name,value);
    PERFORM("履行中",1),
    CONSUME("消费中",2),
    FINISH("归档",3),
    FAILURE("废弃",4);

    private Integer value;
     private String name;


    AppointmentStarusEnum(String name,Integer value) {
        this.name = name;
        this.value=value;
    }

    public static String findName(Integer value){
        AppointmentStarusEnum[] values = AppointmentStarusEnum.values();
        for (AppointmentStarusEnum starus:values){
            if (starus.getValue().equals(value)){
                return starus.getName();
            }
        }
        return null;
    }
}